﻿// =====================================================================
//
//  This file is part of the Microsoft Dynamics CRM SDK code samples.
//
//  Copyright (C) Microsoft Corporation.  All rights reserved.
//
//  This source code is intended only as a supplement to Microsoft
//  Development Tools and/or on-line documentation.  See these other
//  materials for detailed information regarding Microsoft code samples.
//
//  THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
//  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
//  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//  PARTICULAR PURPOSE.
//
// =====================================================================
using System.Runtime.Serialization;

namespace Microsoft.Xrm.Sdk.Metadata
{
	[DataContract(Name = "RelationshipMetadataBase", Namespace = Microsoft.Xrm.Sdk.XmlNamespaces.V5.Metadata)]
	[KnownType(typeof(OneToManyRelationshipMetadata))]
	[KnownType(typeof(ManyToManyRelationshipMetadata))]
	public abstract class RelationshipMetadataBase : MetadataBase
	{
		private bool? _isCustomRelationship;
		private bool? _isValidForAdvancedFind;
		private string _schemaName;
		private SecurityTypes? _securityTypes;
		private bool? _isManaged;
		private BooleanManagedProperty _isCustomizable;

		protected RelationshipMetadataBase()
			: base()
		{
		}

		[DataMember]
		public bool? IsCustomRelationship
		{
			get { return this._isCustomRelationship; }
			set { this._isCustomRelationship = value; }
		}

		[DataMember]
		public BooleanManagedProperty IsCustomizable
		{
			get { return this._isCustomizable; }
			set { this._isCustomizable = value; }
		}

		[DataMember]
		public bool? IsValidForAdvancedFind
		{
			get { return this._isValidForAdvancedFind; }
			set { this._isValidForAdvancedFind = value; }
		}

		[DataMember]
		public string SchemaName
		{
			get { return this._schemaName; }
			set { this._schemaName = value; }
		}

		[DataMember]
		public SecurityTypes? SecurityTypes
		{
			get { return this._securityTypes; }
			set { this._securityTypes = value; }
		}

		[DataMember]
		public bool? IsManaged
		{
			get { return this._isManaged; }
			internal set { this._isManaged = value; }
		}
	}
}
